{% extends 'index.html' %}
{% block content %}
    <table>
            <tr>
                <th>ID</th>
                <th>用户名</th>
                <th>密码</th>
                <th>图片</th>
                <th>类别</th>
                <th>删除</th>
                <th>修改</th>
            </tr>
            {% for i in user %}
            <tr>
                <td>{{ i.id }}</td>
                <td>{{ i.username }}</td>
                <td>{{ i.password }}</td>
                <td><img src="http://127.0.0.1:8000/{{ i.img.url }}" alt="" width="50" height="50"></td>
                {% if i.type == 1 %}
                    <td>老师</td>
                    {% else %}
                    <td>学生</td>
                {% endif %}
                <td><button><a href="/delete?id={{ i.id }}">删除</a></button></td>
                <td><button><a href="/upload?id={{ i.id }}">修改</a></button></td>
            </tr>
            {% endfor %}
        </table>
    {{ mes }}
{% endblock %}